package edu.sctu.practice.class02.yangshengyu.assign03.test01;

/**
 * Created by Cullen on 2015/10/22.
 */
public class Running {
    public static boolean equalArea(GeometricObject object1, GeometricObject object2) {
        if (object1.equals(object2)) {
            return true;
        } else
            return false;
    }

    public static void displayGeometricObject(GeometricObject object) {

        System.out.println(object.name + "的颜色是：" + object.color);

        System.out.println(object.name + "的宽（or 直径）是：" + object.getWeight());

        System.out.println(object.name + "的面积是：" + object.findArea());

        System.out.println(object.name + "的周长是：" + object.findPerimeter());
    }

    public static void main(String[] args) {
        GeometricObject circle = new Circle(5.5, "Cirle", "red");
        displayGeometricObject(circle);

        GeometricObject rectangle = new Rectangle(6.8, 6.8, "Rectangle", "blue");
        System.out.println(rectangle.name + "的高为：" + rectangle.height);
        displayGeometricObject(rectangle);

        System.out.println("两个图形的面试是否相等：" + equalArea(circle, rectangle));
    }

}
